<?php

namespace app\api\logic;

use think\facade\Db;

class TikWebhookLogic extends BasicLogic
{

    /**
     * @desc     订单状态回调MQ消费方法
     * @atuthor  luckyXiong
     * @date     2024-03-22
     */
    public function orderStatusChange($info){

        htmlLog(['data'=>$info],OPERATE_LOG . date('Ym') . '/orderStatusChange/' . date('Ymd') . '.txt');
        //重复执行锁处理;
        $update_time= $info['data']['update_time']??'';
        if(!$info)  return '';

     /*   $type         = $info['type']??'';
        $tik_shop_id  = $info['shop_id']??'';
        $order_id     = $info['data']['order_id']??'';
        $order_status = $info['data']['order_status']??'';
        $config       = Config('Logisticskey.shop_id');
        $shop_id      = $config[$tik_shop_id]??'0';
        if($shop_id==13)  return  true;
        if($type==1){
            $insert_arr = [
                'order_id'    =>$order_id,
                'order_status'=>$order_status,
                'type'        =>$type,
                'shop_id'     =>$shop_id,
                'post'        =>json_encode($info['data'],JSON_UNESCAPED_UNICODE),
                'update_time' =>$update_time,
                'created_time'=>date('Y-m-d H:i:s',time()),
            ];
            Db::name('webhooks')->insert($insert_arr);
            self::changeTypeOrder($info,$shop_id);
        }*/
        return true;
    }
}